<?php
include_once 'config.php';
if ($_POST["weka"] == "no") {
    $ret = exec($program."classify {$_POST["model_name"]} {$_POST["attributes"]}");
} else {
    $ret = exec($program."classifyweka {$_POST["model_name"]} {$_POST["attributes"]}");
}
$result=array();
if ($ret != "fail"){
    $result["status"] = "ok";
    $result["link"] = "http://".$_SERVER["HTTP_HOST"]."/wekaws/data/{$_POST['model_name']}";
    $result["name"] = $_POST['model_name'];
    echo json_encode($result);
} else {
    $result["status"] = "fail";
    echo json_encode($result);
}
?>
